---@class BuffEffect51 : BaseBuffEffect
BuffEffect51 = ClientFight.CreateClass("BuffEffect51", ClientFight.BaseBuffEffect)
local t = BuffEffect51

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local target = buff.target;
    local duelTarget = target.duelTarget;
    if (duelTarget ~= nil) then
        local removeBuffId = buff.buffBean.f_BuffEffectValue[1];
        local removeBuff = BuffManager.getBuffByModel(duelTarget, removeBuffId);
        if (removeBuff ~= nil) then
            BuffManager.removeFighterBuff(fight, duelTarget, removeBuff, true);
        end
    end
    return ClientFight.BaseBuffEffect.action(self,fight, buff, parameters);

end

function t:add(fight, buff)
    local source = buff.source;
    local target = buff.target;
    source.duelTarget = target;
    target.duelTarget = source;

    return ClientFight.BaseBuffEffect.add(self,fight, buff);
end

function t:remove(fight, buff, force, ...)

    local parameters = {...};

    local source = buff.source;
    local target = buff.target;
    source.duelTarget = nil;
    target.duelTarget = nil;

    return ClientFight.BaseBuffEffect.remove(self,fight, buff, force, parameters);
end
t.New()